package org.familysearch.fsapi.gwt.server.servlets;

import java.util.ArrayList;

import org.familysearch.fsapi.gwt.common.client.entities.Temple;
import org.familysearch.fsapi.gwt.server.api.APIException;
import org.familysearch.fsapi.gwt.server.api.TempleAPI;
import org.familysearch.fsapi.gwt.services.client.TempleService;

import com.google.gwt.user.server.rpc.RemoteServiceServlet;

public class TempleServlet extends RemoteServiceServlet implements TempleService {

	private static final long serialVersionUID = -8550962146855113740L;
	private TempleAPI templeAPI = new TempleAPI();

	public TempleServlet()
    {
        
    }

	public ArrayList<Temple> getTemples() {

        ArrayList<Temple> temples = null;
        try {
        	temples = templeAPI.getTemples();
        } catch (APIException e) {
            //TODO: determine which e to throw (API or Server)
        }
		return temples;
	}

	public Temple getTemple(Temple temple) {
        try {
        	temple = templeAPI.getTemple(temple);
        } catch (APIException e) {
            //TODO: determine which e to throw (API or Server)
        }
        return temple;
	}
    
}
